<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 
/**
* This is the default Basket Template. Modify as you like.
*
* @version $Id: basket_b2c.html.php 2409 2010-05-20 20:05:30Z soeren $
* @package VirtueMart
* @subpackage templates
* @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
$db =& JFactory::getDBO();

$q = "SELECT * FROM #__vm_category WHERE `category_publish` = 'Y'";
$db = JFactory::getDBO();
$db->setQuery($q);
$category = $db->loadObjectList();

$category_id = @JRequest::getInt("category_id",$category[0]->category_id);

$q = "SELECT * FROM #__content WHERE `id` = '50'";
$db->setQuery($q);
$term = $db->loadObjectList();

?>
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery("#myModal").draggable();
		jQuery("h2").hide();
			jQuery(".ha-plus").click(function(){
				var target = "#" + $(this).attr("name");
				var hidden =  "#" + $(this).attr("hid");
				var value = parseInt($(target).val()); 
				var frm = "#" + $(this).attr("frm");
				if(isNaN(value)==true){
					alert("Number only");
				}else{
					value += 1;
					$(target).attr("value",value);
					$(hidden).attr("value",value);
					jQuery(frm).submit();
				}
				
			});
			jQuery(".ha-reject").click(function(){
				var target = "#" + $(this).attr("name");
				var hidden =  "#" + $(this).attr("hid");
				var value = parseInt($(target).val()); 
				var frm = "#" + $(this).attr("frm");
				if(isNaN(value)==true){
					alert("Number only");
				}else{
					value -= 1;
					if(value > 0){
						$(target).attr("value",value);
						$(hidden).attr("value",value);
					}else{
						$(target).attr("value",1);
						$(hidden).attr("value",1);
						
					}
					jQuery(frm).submit();
				}
			});
			$(".ha-input-quantity").change(function(){
				var hidden = "#" + $(this).attr("hid");
				var value = parseInt($(this).val());
				
				if(isNaN(value)==true){
					alert("Number only");
				}else{
					if(value > 0){
						$(this).attr("value",value);
						$(hidden).attr("value",value);
					}else{
						$(this).attr("value",1);
						$(hidden).attr("value",1);
					}
					
				}
			});
		}
	);
</script>
<div class="containerUnder">
	<div class="cartLeft">
		<div class="mainTitle"><?php echo $VM_LANG->_('HA_SHOPPING_CART'); ?></div>
		<ul class="cartCategory">
			<?php 
				$current_cat_name = "";
				for($i=0;$i<count($category);$i++){
					if($category_id != $category[$i]->category_id ){
						echo "<li><a href=\"index.php?option=com_virtuemart&page=shop.list&category_id=".$category[$i]->category_id."&Itemid=".$Itemid."\" class=\"cartCategory\">".$category[$i]->category_name."</a></li>";
					}else{
						$current_cat_name = $category[$i]->category_name;
						echo "<li><a id=\"catSelect\" href=\"index.php?option=com_virtuemart&page=shop.list&category_id=".$category[$i]->category_id."\" class=\"cartCategory\">".$category[$i]->category_name."</a></li>";
					}
				}
			?>
		</ul>
	</div>
	<div class="cartRight">
		<div class="step1">
			<ul>
				<li class="select-step"><p><span>1</span><?php echo $VM_LANG->_('HA_STEP_1'); ?></p></li>
				<li><p><span>2</span><?php echo $VM_LANG->_('HA_STEP_2'); ?></p></li>
				<li><p><span>3</span><?php echo $VM_LANG->_('HA_STEP_3'); ?></p></li>
				<li><p><span>4</span><?php echo $VM_LANG->_('HA_STEP_4'); ?></p></li>
			</ul>
		</div>
		<div class="cartHeader">
			<div class="cartHeaderNote">&nbsp;</div>
			<div class="cartHeaderProduce"><?php echo $VM_LANG->_('HA_PRODUCT_LB'); ?></div>
			<div class="cartHeaderSize"><?php echo $VM_LANG->_('HA_SIZE_LB'); ?></div>
			<div class="cartHeaderQty"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_QTY');?></div>
			<div class="cartHeaderPrice"><?php echo $VM_LANG->_('HA_PRICE'); ?></div>
			<div class="cartHeaderTotal"><?php echo $VM_LANG->_('HA_TOTAL'); ?></div>
			<div class="clr"></div>
		</div>
		<?php foreach( $product_rows as $product ) { ?>
		<div class="cartRow">
			<div class="cartHeaderNote">
				
				<div class="cartDel"><?php echo $product['delete_form'] ?></div>
				<div class="cartReload"><?php echo $product['update_form'] ?></div>
			</div>
			<?php echo $product['product_name'] . $product['product_attributes']; ?>
			<?php echo $product['product_sku']; ?>
			<?php echo $product['product_quantity']; ?>
			<?php echo $product['product_price'] ?>
			<?php echo $product['subtotal'] ?>
			<div class="clr"></div>
		</div>
		<?php } ?>
		<div class="cartUnder">
			<div class="cartUnderPrice"><?php echo $subtotal_display ?></div>
			<div class="cartUnderPriceTitle"><?php echo $VM_LANG->_('PHPSHOP_CART_SUBTOTAL') ?></div>
			<div class="clr"></div>
		</div>
		<!--<div class="cartUnder">
			<div class="cartUnderPrice">DKK   0,00</div>
			<div class="cartUnderPriceTitle">Shipping costs  </div>
			<div class="clr"></div>
		</div>-->
		<div class="cartUnder">
			<div class="cartUnderPrice"><span><?php echo $order_total_display ?></span></div>
			<div class="cartUnderPriceTitle"><span><?php echo $VM_LANG->_('HA_TOTAL'); ?></span></div>
			<div class="clr"></div>
		</div>
		<div class="cartButton">
			<div class="cartButtonLeft">
				<a href="index.php?option=com_virtuemart&category_id=<?php echo $category_id ?>"><?php echo $VM_LANG->_('HA_BACK_TO'); ?> <?php echo $current_cat_name; ?></a><br/>
					

				<a data-reveal-id="myModal" href="#"><?php echo $VM_LANG->_('HA_TRANDING_CONDITIONS'); ?></a>
				
				<div id="myModal" class="reveal-modal">
					<?php 
						echo $term[0]->introtext.$term[0]->fulltext;
					?>
					<!--<p>Welcome to the Dummy Text Generator!
						This handy tool helps you create dummy text for all your layout needs.
						We are gradually adding new functionality and we welcome your suggestions and feedback.
						Please feel free to send us any additional dummy texts.</p>
					<p>Welcome to the Dummy Text Generator!
						This handy tool helps you create dummy text for all your layout needs.
						We are gradually adding new functionality and we welcome your suggestions and feedback.
						Please feel free to send us any additional dummy texts.</p>-->

					 <a class="close-reveal-modal">&#215;</a>
				</div>
			</div>
			<div class="cartButtonRight">
				<a class="btn btn-til" href="index.php?page=shop.userinfo&ssl_redirect=1&option=com_virtuemart"><span><?php echo $VM_LANG->_('HA_PROCESS_TO_PURCHASE'); ?></span></a>
				
			</div>
			<div class="clr space20"></div>
			<!--<div>
			<a href="#"><img src="<?php echo JURI::base() ?>templates/rhuk_milkyway/images/footer_banner.jpg" alt=""/></a>
			</div>-->
		</div>
		<div class="cartInfo">
			<div class="cartInfoTxt">Pay by Dankort, Visa, Visa Electron, Mastercard og Maestro</div>
			<img src="<?php echo JURI::base(); ?>templates/rhuk_milkyway/images/cart_master1.png" alt=""/>
			<img src="<?php echo JURI::base(); ?>templates/rhuk_milkyway/images/cart_master.png" alt=""/>
			<img src="<?php echo JURI::base(); ?>templates/rhuk_milkyway/images/cart_visa1.png" alt=""/>
			<img src="<?php echo JURI::base(); ?>templates/rhuk_milkyway/images/cart_visa.png" alt=""/>
			<img src="<?php echo JURI::base(); ?>templates/rhuk_milkyway/images/cart_DK.png" alt=""/>
			<div class="clr"></div>
		</div>
	</div>
	<div class="clr"></div>
</div>
